<template>
  <div class="container ny_content">
    <div class="ny_nav">
      <div class="ny_nav_h">
        <div>
          <h2>市场调研</h2>
          <p>MARKET RESEARCH</p>
        </div>
      </div>
      <div class="ny_nav_dqwz">
        当前位置：<span class="hidden-xs">服务项目></span>市场调研
      </div>
    </div>
    <div class="ny_view">
      <div class="ny_news_nav" id="ny_fwxm_fwzl">
        <a href="javascript:void(0)" v-for="(item,index) in marketTypeList" :key="index"
           :class="index == queryInfo.currentValue ? 'news_btn news_on ' : 'news_btn' "
           @click="handleChange(index)">{{ item }}</a>
      </div>
      <div id="fwzl_nr" v-for="(c_item,c_index) in  marketList" :key="c_index">
        <div class="ql-snow">
          <div class="ql-editor" v-html="c_item.content">
          </div>
        </div>
      </div>

    </div>
  </div>
</template>

<script>
export default {
  name: 'index',
  data () {
    return {
      marketTypeList: [],
      marketList: [],
      queryInfo: {
        limit: 110,
        page: 1,
        currentValue: 1,
      },
    }
  },
  created () {
    this.getMarketTypeList()
    this.handleChange(this.queryInfo.currentValue)
  },
  methods: {
    async getMarketTypeList () {
      const {data: res} = await this.$http.get('home/market_type_list')
      if (res.code !== 200) return false
      this.marketTypeList = res.data.list
    },
    async handleChange (index) {
      this.queryInfo.currentValue = index
      const {data: res} = await this.$http.get('home/market_list', {params: this.queryInfo})
      if (res.code !== 200) return false
      this.marketList = res.data.list
    },
  }
}
</script>

<style scoped>

</style>
